﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;
using System.Data.SqlClient;

namespace BLL
{
   public class UserInfoBll
    {
       UserInfoDal dal = new UserInfoDal();

       public List<UserInfo> ShowUserInfo()
       {
           return dal.Show();
       }
       public List<UserInfo> ShowUserInfo(int PageIndex,int PageSize,out int PageCount)
       {
           PageCount = dal.Show().Count();
           return dal.Show().Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList();
       }
       public bool Register(UserInfo n1)
       {
           return dal.Add(n1);
       }

       /// <summary>
       /// 删除用户
       /// </summary>
       /// <param name="m"></param>
       /// <returns></returns>
       public bool DelUser(UserInfo m)
       {
           return dal.Del(m);
       }
      public List<UserInfo> SeleName(params SqlParameter[] paramters)
       {
           return dal.Show(paramters);
       }


      public UserInfo BackUser(int id)
      {
          return dal.Back(id);
      }
      public bool UpdUser(UserInfo m, int id)
      {
          return dal.Update(m, id);
      }





    }
}
